﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ex7.StringEncoding
{
    class StringEncoding
    {
        static void Main(string[] args)
        {
            //Console.Write("Enter text: ");
            //string text = Console.ReadLine();

            //Encoding utf16le = Encoding.ASCII;
            //byte[] bytesASCII = utf16le.GetBytes(text);
            //foreach (var b in bytesASCII)
            //{
            //     Console.Write("0x{0:X} ",b);
            //}
            //Console.WriteLine();

            //Encoding utf8le = Encoding.UTF8;
            //byte[] bytesUTF = utf8le.GetBytes(text);
            //foreach (var b in bytesUTF)
            //{
            //    Console.Write("0x{0:X} ", b);
            //}
            //Console.WriteLine();

            //Encoding win1252le = Encoding.Unicode;
            //byte[] bytesWin = win1252le.GetBytes(text);
            //foreach (var b in bytesWin)
            //{
            //    Console.Write("0x{0:X} ", b);
            //}
            //Console.WriteLine();

            Encoding utf8 = Encoding.UTF8;
            string mathStr = "Ω(x) ≤ Ψ(x)π² ≤ ∫φ(x) ∂x ≤ ⅔";
            Console.WriteLine(mathStr);

            byte[] bytesUTF8 = utf8.GetBytes(mathStr);
            Console.WriteLine(BitConverter.ToString(bytesUTF8));

            string mathStrRecovered = utf8.GetString(bytesUTF8);
            Console.WriteLine(mathStrRecovered);
        }
    }
}
